home *** CD-ROM | disk | FTP | other *** search
- >
- > BTW, for those of you using the new GCC, something that has been discovered
- > by Dave Gilbert:
- >
- > When compiling the kernel, turn off some of the optimisations, specifically
- > the one that allows GCC/EGCS to assume that all structures are word aligned.
- > GCC will try to load a short using a LDR with a shift. EG, to access bytes
- > 12 and 13 only of a structure, GCC will use by default:
- > ldr r0, [r1, #14]
- > mov r0, r0, lsr #16
- >
- > This means that if r1 isn't word aligned (it certainly isn't for IP ethernet
- > packets in this case), the LDR picks up the wrong data.
- >
- > Does anyone know if this is a legal optimisation that the compiler is making?
-
- All you need to add is -mshort-load-bytes to the command line. Phil told
- me about this one already.
-
- > BTW, don't say that it should be word aligned. If that structure was word
- > aligned, then the IP structures won't be, which will be even worse. Blame
- > Xerox for that one!
-
- Cuh, those Xerox guys, hey? Fancy not optimising a network protocol for
- a 32 bit CPU due to be designed in 20 years time.. ;-)
-
- unsubscribe: body of `unsubscribe linux-arm' to majordomo@vger.rutgers.edu
-
-